package com.globagames.strategicgames.business
{
	import com.globagames.isometric.core.view.IsoMap;
	import com.globagames.isometric.core.view.IsoOperation;
	import com.globagames.strategicgames.model.StrategicGameModelLocator;
	
	import mx.messaging.Consumer;
	import mx.messaging.events.MessageEvent;
	import mx.messaging.events.MessageFaultEvent;
	
	public class ConnectConsumer extends Consumer
	{
		
		private var model:StrategicGameModelLocator = StrategicGameModelLocator.getInstance();
	
		public function ConnectConsumer(playerId:int)
		{
			destination = "connectMessages";
			subtopic = ""+playerId;				
			
			addEventListener(MessageFaultEvent.FAULT, faultHandler);
			subscribe();
		}
		public function messageHandler(event:MessageEvent):void
		{
			dispatchEvent(event);
			trace("messageHandler "+event.message.body);									
		}
		public function faultHandler(event:MessageFaultEvent):void
		{
			trace("faultHandler");
		}	
		
	}
}